import App from './App'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import request from "@/api/request";
import {createSSRApp} from 'vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

export function createApp() {
    const app = createSSRApp(App)

    // 注册Element Plus
    app.use(ElementPlus)
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
        app.component(key, component)
    }
    // 挂载request到全局属性
    app.config.globalProperties.$request = request

    return {
        app
    }
}
